package com.source.utils;

import com.source.baseData.entity.District;
import com.source.baseData.service.DistrictService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Iceberg777
 */

@Slf4j
@Component
public class DistrictBuilder {

    @Autowired
    DistrictService districtService;

    public Map<String,String> getPCDName(String provinceId, String cityId, String districtId){
        District province = districtService.getById(provinceId);
        District city = districtService.getById(cityId);
        District district = districtService.getById(districtId);
        Map<String,String> map = new HashMap<>();
        map.put("province",province.getName());
        map.put("city",city.getName());
        map.put("district",district.getName());
        return map;
    }


}
